<?php include('_init_.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="../css/admin-body.css" rel="stylesheet" type="text/css" />
<link href="../css/admin.css" rel="stylesheet" type="text/css" />
<link href="../css/uploadify.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body,td,th {
	font-family: 微軟正黑體, "儷黑 Pro", Arial, Helvetica, sans-serif;
}
</style>
<script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../js/swfobject.js"></script>
<script type="text/javascript" src="../js/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript">
// <![CDATA[
$(function(){
	$(".uploadifyupload").each(function(){
		
		var previous_img_id = $(this).attr('name');
		$(this).uploadify({
			'uploader': 'uploadify.swf',
			'cancelImg': 'cancel.png',
			'script': 'uploadify.php',
			'folder': 'files',
			'multi': false,
			'fileExt':'*.jpg;*.jpeg;*.gif;*.png',
				'fileDesc':'Image Files',
			'auto': true,
			'scriptData':{'<?php echo session_name();?>':'<?php echo session_id();?>','name':$(this).attr('name'),'responsetype':'sizeinfo'},
			'displayData': 'speed',
			'onComplete':function(event,queueID,fileObj,response,data){
				var responseObj = eval("("+response+")");
				var fileName = responseObj.name;
				$('#img_'+previous_img_id).attr('src','../img/tmp/' + fileName);
				$('input[name=ajaxf_'+previous_img_id+']').val(fileName);
				
			},
			'onError':function(event,queueId,fileObj,errorObj){
				alert(errorObj);
			}
		});
	});
});
// ]]>
</script>
<title>班尼頓寫真後台管理</title>
</head>

<body>
<?php include_once('admin-top.php');?>
<div id="main" class="clearfix"><!-- star #main //-->
<?php include_once('sub-index.php');?>
  
   <form method="post" action="<?php echo $_SERVER['PHP_SELF']?>"> 
  <div id="contact"><!-- star #contact //-->
    <ul>
    <li class="tit-a">Banner管理<span class="nav_note">size: 924 X 60</span></li>
    <li class="impotc">
     名稱： <input name="site_name" type="text" class="impotc-keyina" value="<?php echo Util::getGlobalValue('site_name');?>" />
      </li>
    <li class="impotc">
      網址：<input name="site_url" type="text" class="impotc-keyinb"  value="<?php echo Util::getGlobalValue('site_url');?>" />
      </li>
    <li class="impota">
        <input class="uploadifyupload" type="file" name="banner" id="bannerswfupload"/> 
        <input name="ajaxf_banner" type="hidden"/>
      </li>
      <?php 
      $banner_image = '../img/topbanner.jpg';
      $cfg_site_banner = Util::getGlobalValue('site_banner');
      if ( $cfg_site_banner ) {
      	$banner_image = constant('SITE_URL_PATH').'/img/'.$GLOBALS['GV_IMAGE_PATH'].$cfg_site_banner;
      }
      ?>
      <li class="maina"><img id="img_banner" src="<?php echo $banner_image;?>" width="924" height="160" /> </li>
      <li class="ce-7"><a href="#" onclick="document.forms[0].submit();return false;">儲存</a></li>
    </ul>
  </div><!-- end #contact //-->
</div><!-- end #main //-->
</form>
</body>
</html>